package com.lagou.service;

import com.alibaba.fastjson.JSON;

/**
 * @Author wyx
 * @Date 2020/3/14 23:12
 */
public class JSONSerializer implements Serializer {



    public byte[] serialize(Object object) {
        return JSON.toJSONBytes(object);
    }



    public <T> T deserialize(Class<T> clazz, byte[] bytes) {
        return JSON.parseObject(bytes, clazz);
    }

}